﻿package com.artionscript.tools.stamps.splatter {

	import com.artionscript.tools.FillVO;
	import com.artionscript.tools.LineVO;
	import com.artionscript.tools.stamps.ArcStamp;
	import com.artionscript.tools.Tool;
	import flash.display.Sprite;
	/**
	 * ...
	 * @author Trevor Boyle
	 */
	public class SplatterStamp2 extends Tool
	{
		
		private const DEFAULT_WIDTH:Number = 50;
		
		public function SplatterStamp2(width:Number=0, height:Number=0, fillVO:FillVO=null, lineVO:LineVO=null, centre:Boolean=false) 
		{
			var container:Sprite = new Sprite();
			
			var s:Sprite = new Sprite;
			setFillAndLineStyle(fillVO, lineVO, s);
			s.graphics.drawPath(Vector.<int>([1,3,3,3,2,3,3,3,3,3,2,3,3,3,3,3,3,2,3,3,3,3,3,3,2,2,2,3,3,2,3,3,3,2,3,2]),Vector.<Number>([-4.004,-0.44,-4.132113980470211,-0.8489792453472143,-4.986,0.181,-3.587245844830905,1.590597210635522,-4.004,0.441,-4.520865979381443,1.0877067085014174,-5.143,0.7,-5.247,0.7,-5.073781839151271,0.8417517224582193,-4.03725,0.9767499999999999,-3.1983179081563162,1.0860128157627602,-3.018,1.684,-4.0482788461538455,1.684,-3.2779999999999996,2.3049999999999997,-2.8120800324902433,2.3330292375459893,-2.248375,2.7593749999999995,-1.640864640605136,3.218851947066986,-1.2569999999999997,3.2909999999999995,-1.619,3.55,-1.8221832997271983,3.487598007353813,0.7129999999999999,3.654,0.4197757506469125,4.1093235702982795,1.129,4.133624999999999,1.9290882933756108,4.161039868335891,1.854,4.536,2.6737631954524206,3.4033803193266072,3.202,4.016,5.223,2.8304077010192534,5.223,1.424,5.171536444899628,1.5118991850199188,4.965,-0.077,4.809,0.076,4.65723113964687,-0.6599357945425358,4.705,-0.7,3.9170571244690446,-0.8979373407130903,3.721,-1.4249999999999998,3.721,-2.6371249999999993,2.838,-2.306,2.734,-2.3762337662337663,2.734,-2.669,2.306429951690821,-2.669,2.113,-2.9290000000000003,-0.7806947368421036,-3.9419326803024903,-1.152,-4.276,-0.7889999999999999,-4.069999999999999,-0.9979999999999999,-3.6549999999999994,-1.8769999999999998,-4.536,-1.5400062167790867,-2.996400951167201,-1.412,-3.188,-1.4665534246575342,-3.141111106079475,-2.5,-3.292,-2.137,-3.032,-2.3144019478300133,-2.830162522165853,-2.8301250000000002,-2.980875,-3.375615788204578,-3.1402866609294318,-3.641,-2.929,-2.970770418567149,-2.1479619965967096,-4.106,-1.4249999999999998,-5.35,-1.4249999999999998,-4.163943729903538,-1.4250000000000003,-4.004,-0.44,-4.004,-0.44]),"nonZero");
			s.graphics.endFill();
			container.addChild(s);
			
			if (width == 0) {
				width = DEFAULT_WIDTH;
			}
			
			if (height == 0) {
				height = (width / container.width) * container.height;
			}
			
			container.width = width;
			container.height = height;
			
			if (centre) {
				container.x = 0 - container.width / 2;
				container.y = 0 - container.height / 2;
			}
			
			this.addChild(container);
		}
		
	}

}